﻿using System;
using UnityEngine;

// Token: 0x020001FF RID: 511
public class EjaculationEmitter : MonoBehaviour
{
	// Token: 0x06000E0F RID: 3599 RVA: 0x00057C04 File Offset: 0x00055E04
	private void Start()
	{
	}

	// Token: 0x06000E10 RID: 3600 RVA: 0x00057C08 File Offset: 0x00055E08
	private void Update()
	{
	}

	// Token: 0x06000E11 RID: 3601 RVA: 0x00057C0C File Offset: 0x00055E0C
	public void Emit()
	{
		for (int i = 0; i < this.emitNum; i++)
		{
			float y = UnityEngine.Random.Range(this.directionMin, this.directionMax);
			float x = UnityEngine.Random.Range(this.elevationMin, this.elevationMax);
			float d = UnityEngine.Random.Range(this.speedMin, this.speedMax);
			Quaternion rotation = base.transform.rotation * Quaternion.Euler(x, y, 0f);
			Vector3 velocity = rotation * Vector3.forward * d;
			int num = UnityEngine.Random.Range(0, this.original.Length);
			GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.original[num]);
			gameObject.SetActive(true);
			Vector3 vector = new Vector3(UnityEngine.Random.Range(this.minOffset.x, this.maxOffset.x), UnityEngine.Random.Range(this.minOffset.y, this.maxOffset.y), UnityEngine.Random.Range(this.minOffset.z, this.maxOffset.z));
			vector = base.transform.rotation * vector;
			gameObject.transform.position = base.transform.position + vector;
			gameObject.transform.rotation = base.transform.rotation;
			gameObject.transform.SetParent(this.setParent);
			Rigidbody[] componentsInChildren = gameObject.GetComponentsInChildren<Rigidbody>();
			foreach (Rigidbody rigidbody in componentsInChildren)
			{
				rigidbody.velocity = velocity;
			}
		}
	}

	// Token: 0x04000E77 RID: 3703
	public GameObject[] original;

	// Token: 0x04000E78 RID: 3704
	public Vector3 minOffset;

	// Token: 0x04000E79 RID: 3705
	public Vector3 maxOffset;

	// Token: 0x04000E7A RID: 3706
	[Range(-180f, 0f)]
	public float directionMin;

	// Token: 0x04000E7B RID: 3707
	[Range(0f, 180f)]
	public float directionMax;

	// Token: 0x04000E7C RID: 3708
	[Range(-180f, 0f)]
	public float elevationMin;

	// Token: 0x04000E7D RID: 3709
	[Range(0f, 180f)]
	public float elevationMax;

	// Token: 0x04000E7E RID: 3710
	public float speedMin = 1f;

	// Token: 0x04000E7F RID: 3711
	public float speedMax = 1f;

	// Token: 0x04000E80 RID: 3712
	public int emitNum = 1;

	// Token: 0x04000E81 RID: 3713
	public Transform setParent;
}
